package com.happyhome.datamodel;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * The persistent class for the province database table.
 * 
 */
@Entity
@Table(name="PROVINCE")
public class Province implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long idProvince;
	private String codeProvince;
	private String fullName;
	private Boolean status;
	private Set<Customer> customers = new HashSet<Customer>();
	private Set<District> districts = new HashSet<District>();

	public Province() {
	}


	@Id
	@Column(name="ID_PROVINCE")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getIdProvince() {
		return this.idProvince;
	}

	public void setIdProvince(Long idProvince) {
		this.idProvince = idProvince;
	}


	@Column(name="CODE_PROVINCE")
	public String getCodeProvince() {
		return this.codeProvince;
	}

	public void setCodeProvince(String codeProvince) {
		this.codeProvince = codeProvince;
	}


	@Column(name="FULL_NAME")
	public String getFullName() {
		return this.fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@Column(name="STATUS")
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}


	//bi-directional many-to-one association to Customer
	@OneToMany(mappedBy="province", fetch = FetchType.LAZY)
	public Set<Customer> getCustomers() {
		return this.customers;
	}

	public void setCustomers(Set<Customer> customers) {
		this.customers = customers;
	}

	//bi-directional many-to-one association to District
	@OneToMany(mappedBy="province", fetch = FetchType.LAZY)
	public Set<District> getDistricts() {
		return this.districts;
	}

	public void setDistricts(Set<District> districts) {
		this.districts = districts;
	}
}